package com.zte.claa.inficombo.csa.app.model.version;

import java.sql.Timestamp;

public class VersionUpdateTask {
	public static final int NEEDCONFIRM_Y = 1;
	public static final int NEEDCONFIRM_N = 0;
	
	/**
	 * 0--未下发准备指令；1--已下发准备指令；2--升级执行中；3--升级执行结束；
	 */
	public static final int STATUS_INIT  = 0;
	public static final int STATUS_READY = 1;
	public static final int STATUS_RUN   = 2;
	public static final int STATUS_OVER  = 3;
	
	/**
	 * 0--新建；1--启动；2--撤销；3--完成；
	 */
	public static final int MGR_STATE_INIT   = 0;
	public static final int MGR_STATE_START  = 1;
	public static final int MGR_STATE_CANCEL = 2;
	public static final int MGR_STATE_FINISH = 3;
	
	private String taskid; 		//		任务编号	VARCHAR(200)		N	主键
	private String projectid; 	//		项目编号	VARCHAR(200)		N	创建索引
	private String projectname; //		项目名称	VARCHAR(100)		Y	
	private String taskname; 	//		任务名称	VARCHAR(100)		N	
	private String devtype; 	//		设备类型ID	VARCHAR(100)		N	创建索引
	private String version; 	//		版本编号	VARCHAR(100)		N	
	private String appeui; 		//		应用编号	VARCHAR(50)		N	
	private int needconfirm = 0; //     是否需要确认（按确认帧下发）0-否；1-是；
	private int devport = 0; 	//		设备端口号	Int	0	N	
	private int repeatnum = 0; 	//		广播重复次数	Int	0	N	重复执行次数，0表示不重复广播
	private int interval = 3; 	//		版本块下发间隔	Int	5	N	自动广播的间隔，单位：秒
	private int curblockno = 0; //		数据块编号	Int	0	N	当前升级广播的版本数据块编号
	private Timestamp createtime; //	创建时间	Timestamp		Y	任务创建时间
	private Timestamp optime;     //    任务最近更新时间.
	private Timestamp starttime;  //    任务实际开始下发版本数据块的广播时间点.
	private int status = STATUS_INIT; 	  	//	任务状态	Int	0	N	
	private int mgrstate = MGR_STATE_INIT;  // 管理状态.
	private float dwfrequency = 0; 	//   下行广播频率； 
	private String bcastkey;		//	广播密钥	Varchar(100)，十六进制数字字符串
	private int dr = 0;				// 	下发DR	Int
	private String remark; 		  	//	备注	Varchar(200)		Y	
	
	public VersionUpdateTask(){
		
	}

	public String getTaskid() {
		return taskid;
	}

	public void setTaskid(String taskid) {
		this.taskid = taskid;
	}

	public String getProjectid() {
		return projectid;
	}

	public void setProjectid(String projectid) {
		this.projectid = projectid;
	}

	public String getProjectname() {
		return projectname;
	}

	public void setProjectname(String projectname) {
		this.projectname = projectname;
	}

	public String getTaskname() {
		return taskname;
	}

	public void setTaskname(String taskname) {
		this.taskname = taskname;
	}

	public String getDevtype() {
		return devtype;
	}

	public void setDevtype(String devtype) {
		this.devtype = devtype;
	}

	public String getVersion() {
		return version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getAppeui() {
		return appeui;
	}

	public void setAppeui(String appeui) {
		this.appeui = appeui;
	}

	public int getDevport() {
		return devport;
	}

	public void setDevport(int devport) {
		this.devport = devport;
	}

	public int getRepeatnum() {
		return repeatnum;
	}

	public void setRepeatnum(int repeatnum) {
		this.repeatnum = repeatnum;
	}

	public int getInterval() {
		return interval;
	}

	public void setInterval(int interval) {
		this.interval = interval;
	}

	public int getCurblockno() {
		return curblockno;
	}

	public void setCurblockno(int curblockno) {
		this.curblockno = curblockno;
	}

	public Timestamp getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Timestamp createtime) {
		this.createtime = createtime;
	}

	public Timestamp getOptime() {
		return optime;
	}

	public void setOptime(Timestamp optime) {
		this.optime = optime;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getMgrstate() {
		return mgrstate;
	}

	public void setMgrstate(int mgrstate) {
		this.mgrstate = mgrstate;
	}

	public int getNeedconfirm() {
		return needconfirm;
	}

	public void setNeedconfirm(int needconfirm) {
		this.needconfirm = needconfirm;
	}
	
	public Timestamp getStarttime() {
		return starttime;
	}

	public void setStarttime(Timestamp starttime) {
		this.starttime = starttime;
	}

	public float getDwfrequency() {
		return dwfrequency;
	}

	public void setDwfrequency(float dwfrequency) {
		this.dwfrequency = dwfrequency;
	}

	public String getBcastkey() {
		return bcastkey;
	}

	public void setBcastkey(String bcastkey) {
		this.bcastkey = bcastkey;
	}

	public int getDr() {
		return dr;
	}

	public void setDr(int dr) {
		this.dr = dr;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append("taskid=").append(this.taskid).append(", ");
		sb.append("projectid=").append(this.projectid).append(", ");
		sb.append("devtype=").append(this.devtype).append(", ");
		sb.append("version=").append(this.version).append(", ");		
		sb.append("projectname=").append(this.projectname).append(", ");
		sb.append("taskname=").append(this.taskname).append(", ");
		sb.append("appeui=").append(this.appeui).append(", ");
		sb.append("devport=").append(this.devport).append(", ");		
		sb.append("needconfirm=").append(this.needconfirm).append(", ");
		sb.append("repeatnum=").append(this.repeatnum).append(", ");
		sb.append("interval=").append(this.interval).append(", ");
		sb.append("curblockno=").append(this.curblockno).append(", ");
		sb.append("createtime=").append(this.createtime).append(", ");
		sb.append("optime=").append(this.optime).append(", ");	
		sb.append("starttime=").append(this.starttime).append(", ");		
		sb.append("status=").append(this.status).append(", ");
		sb.append("mgrstate=").append(this.mgrstate).append(", ");
		sb.append("dwfrequency=").append(this.dwfrequency).append(", ");
		sb.append("bcastkey=").append(this.bcastkey).append(", ");
		sb.append("dr=").append(this.dr).append(", ");
		sb.append("remark=").append(this.remark);
		return sb.toString();
	}
}
